<?
require 'config.php';
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>consulta</title>
		<meta name="author" content="Matheus" />
		<link  rel="stylesheet" type="text/css" href="login.css"/>
		<!-- Date: 2012-03-02 -->
		
		
<!-- jquery 		 -->
			
			
		<link rel="stylesheet" href="../js/jquery.superbox.css" type="text/css" media="all" />
		<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
		<script type="text/javascript" src="../js/jquery.superbox-min.js"></script>
		<link rel="stylesheet" type="text/css" href="../js/Javascript/estiloDataGrid.css">
		<script type="text/javascript" src="ajax.js" type="text/javascript"></script>
		
		
		<script type="text/javascript">
		$(function(){
			$.superbox.settings = {
				closeTxt: "Fechar",
				loadTxt: "Carregando...",
				overlayOpacity: .8,
				boxWidth: "600",
				boxHeight: "400", 
			};
			$.superbox();
		});
	</script>
		
<!-- 		 -->
	</head>
	<body>
		
						<div id="conteudocima">
					
							<a  href="logado.php"><p>Home </p></a>
							<a  href="novo.php"><p>Novo </p></a>
							<a href="../js/Javascript/index.php"><p>Cadastrar Produto</p></a>
							<a href="consulta.php"><p>Conulta </p></a>
							
							<p style="margin-right:40px;	 float: right">Admin Logado | <a href="login.php" style="text-decoration: none; color: #FFFFFF" > Sair</a></p>
							
							
			</div>
			
			<div id="conteudoesquerdo">
					<div id="conteudocima2">
								<p  style="margin-top: 10px; margin-left: 70px"> Logados</p>		
								
									<?
								$query = "SELECT *  FROM usuarios WHERE status = 'a'";
								$result = mysql_query($query);
								
								if($result){
									while ($row = mysql_fetch_assoc($result)) {
										echo "<p style='color:#000000; margin-left:70px;'>".$row['usuario']."</p>";
										
									}
								}
							
							?> 
								
					</div>
			</div>
							<div id="conteudo">
	<!-- 							
												<h4>Consultar Produtos: </h4>
												
			<form id="cadastro" name="cadastro" method="post" >
  <table cellspacing="5" cellpadding="0" style="margin-left: 107px; margin-top: 31px; border: 1px solid #6C7B8B; width: 90px;">
    <tr>
      <td width="69">Cod.Produto:</td>
			<td><input type="text" id="texto" onkeypress="Buscar();" size="30" /></td>
				<td><input type="button" id="texto" onclick="Buscar();" value="Pesquisar" size="30" /></td>

      	     <td> <a href="consultarprod.php" rel="superbox[ajax][consultarprod.php]" style="text-decoration: none"> <input name="cadastrar" type="submit" id="texto" onkeypress="Buscador();" value="Consultar" style="-moz-border-radius: 10px;" </a></> 
     	
  </td>
    </tr> -->
    
    <form name="formulario">
	<table id="minhaTabela" cellpadding="1" cellspacing="1">
		<tr>
			<td colspan="5" id="titulo"><strong>CONSULTAR PRODUTOS</strong></td>
		</tr>
		<tr id="cabecalho">
			<td id="codigo"><strong>C&oacute;digo</strong></td>
			<td id="nome"><strong>Descri&ccedil;&atilde;o:</strong><input type="text" id="texto" onkeypress="Buscar();" size="62" /></td>
			<!-- <td id="preco"><strong>Pre&ccedil;o (R$):</strong></td> -->
			<td id="editar"><strong><input type="button" id="texto" onclick="Buscar();" value="Pesquisar" size="30" /></strong></td>
		</tr>
<!-- 		<?php

$bd = "teste";
	$local = "localhost";
	  $user ="root";
	 $senha = "";
	
	if(!@mysql_connect($local,$user,$senha)){
		echo "Erro ao tentar conectar";
	} else {
				if (!@mysql_select_db($bd)) {
					echo "Banco de dados nao existe";
				}
	}

$query = mysql_query("SELECT * FROM produtos WHERE nome LIKE '%$q%'");
$total = mysql_num_rows($res);



for($i=0; $i<$total; $i++){
	$dados = mysql_fetch_row($res);
	$codigo = $dados[0];
	$nome = $dados[1];
	$preco = $dados[2];
	$preco = number_format($preco,2,',','.'); //formata o preço
	$idLinha = "linha$i";
	echo '<tr id="'.$idLinha.'">';
	echo '<td class="linhas" align="center">'.$codigo.'</td>';
	echo "<td class=\"linhas\">$nome</td>";
	echo "<td class=\"linhas\">$preco</td>";
	// echo "<td class=\"linhas\"><a href=\"#\" onclick=\"EditarLinha('$idLinha', '$codigo');\"><img src=\"images/editar.gif\" alt=\"Editar\" title=\"Editar\"></a></td>";
	// echo "<td class=\"linhas\"><a href=\"#\" onclick=\"ExcluirLinha('$idLinha', '$codigo');\"><img src=\"images/excluir.gif\" alt=\"Excluir\" title=\"Excluir\"></a></td>";
}
?> -->
        
    </table>

    
    <div id="dadoconsulta">
    
         
    </div>
	    
		</div>
		
	</body>
</html>
